#define _CRT_SECURE_NO_WARNINGS 1

#include "binarytree.h"

void test_strcreattree()
{
	char str[] = "ABD##E#H##CF##G##";
	int pi = 0;
	BTNode* root = BinaryTreeCreate(str, &pi);
	BinaryTreePrevOrder(root);
	printf("\n");
	BinaryTreeInOrder(root);
	printf("\n");
	BinaryTreePostOrder(root);
	printf("\n");

	printf("TreeNodeSize:>%d\n", BinaryTreeSize(root));
	printf("TreeLeafNodeSize:>%d\n", BinaryTreeLeafSize(root));
	printf("BinaryTreeLevelKSize:>%d\n", BinaryTreeLevelKSize(root, 3));
	BTNode* find = BinaryTreeFind(root, 'C');
	printf("find node vla:>%c,find node left:>%c,find node right:>%c\n", find->val, find->left->val, find->right->val);

	BinaryTreeLevelOrder(root);
	printf("BinaryTreeComplete:>%d\n", BinaryTreeComplete(root));

	BinaryTreeDestroy(&root);
}

void main()
{
	test_strcreattree();
	return 0;
}